Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cool#9992 doc sign: fix handling of saveas options containing spaces #10409

Merged
merged 1 commit into from
Nov 4, 2024

Conversation

vmiklos
Copy link
Contributor

@vmiklos vmiklos commented Nov 4, 2024

Trying to create signed PDFs during ODT->PDF conversion, a signature is
created, but it's not valid. The first trouble noticed while
investigating is that the load option we get is like this:

debug:666:660: doc_saveAs: pFilterOptions is '{"SignPDF":{"type":"boolean","value":"true"},"SignCertificateCaPem":{"type":"string","value":"-----BEGINCERTIFICATE-----

While this should be '-----BEGIN CERTIFICATE-----', since the syntax is
"load ... [options=]".

Fix the problem in ChildSession::saveAs(), where a space was lost while
"load ... options=foo bar" was tokenized as "load", "...", "options=foo"
and "bar", and later we constructed as "foobar", not "foo
bar".

Signed-off-by: Miklos Vajna vmiklos@collabora.com
Change-Id: Ibadcb3218d8776191193ca13788cfca4a8d1e11d

@vmiklos vmiklos mentioned this pull request Nov 4, 2024
@vmiklos
Copy link
Contributor Author

vmiklos commented Nov 4, 2024

https://cpci.cbg.collabora.co.uk:8080/job/github_online_master_debug_vs_co-24.04_cypress_desktop/2174/console fails in:

writer/invalidations_spec.js
writer/searchbar_spec.js

But

make -C cypress_test check-desktop spec=writer/invalidations_spec.js

passes for me, retry.

@vmiklos
Copy link
Contributor Author

vmiklos commented Nov 4, 2024

Ah and this is about saveas, not load, let me fix the commit message.

Trying to create signed PDFs during ODT->PDF conversion, a signature is
created, but it's not valid. The first trouble noticed while
investigating is that the saveas option we get is like this:

debug:666:660: doc_saveAs: pFilterOptions is '{"SignPDF":{"type":"boolean","value":"true"},"SignCertificateCaPem":{"type":"string","value":"-----BEGINCERTIFICATE-----

While this should be '-----BEGIN CERTIFICATE-----', since the syntax is
"saveas ... [options=<options>]".

Fix the problem in ChildSession::saveAs(), where a space was lost while
"saveas ... options=foo bar" was tokenized as "saveas", "...", "options=foo"
and "bar", and later we constructed <options> as "foobar", not "foo
bar".

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: Ibadcb3218d8776191193ca13788cfca4a8d1e11d
@vmiklos vmiklos force-pushed the private/vmiklos/master branch from 0e29f0b to 9a29f0c Compare November 4, 2024 10:09
@vmiklos vmiklos changed the title cool#9992 doc sign: fix handling of load options containing spaces cool#9992 doc sign: fix handling of saveas options containing spaces Nov 4, 2024
@vmiklos vmiklos requested a review from caolanm November 4, 2024 10:49
@vmiklos
Copy link
Contributor Author

vmiklos commented Nov 4, 2024

@caolanm could you please review this? Thanks.

At least now the input for the PDF signature looks good. The binary signature still has some bug that I need to debug, but this is a precondition, otherwise the CA chain will have missing items.

@vmiklos vmiklos merged commit ebc753b into master Nov 4, 2024
13 checks passed
@vmiklos vmiklos deleted the private/vmiklos/master branch November 4, 2024 11:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants